package Finance::NSCC::Insurance::Schema::Party;

use strict;
use warnings;

use base 'DBIx::Class';

__PACKAGE__->load_components("Core");
__PACKAGE__->table("parties");
__PACKAGE__->add_columns(
  "id",
  { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
  "nscc_num",
  { data_type => "CHAR", default_value => "", is_nullable => 0, size => 4 },
  "contract_num",
  { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 30 },
  "tax_id",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 20,
  },
  "tax_id_q",
  { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 2 },
  "role",
  { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 3 },
  "type_code",
  { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 1 },
  "impaired_risk",
  { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 },
  "entity_i",
  { data_type => "TINYINT", default_value => "", is_nullable => 0, size => 1 },
  "entity_name",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 105,
  },
  "first_name",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 25,
  },
  "last_name",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 35,
  },
  "middle_name",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 25,
  },
  "prefix",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 10,
  },
  "suffix",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 10,
  },
  "address_line1",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 35,
  },
  "address_line2",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 35,
  },
  "address_line3",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 35,
  },
  "city",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 30,
  },
  "state",
  { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 2 },
  "zip",
  {
    data_type => "VARCHAR",
    default_value => undef,
    is_nullable => 1,
    size => 15,
  },
  "country_code",
  { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 3 },
);
__PACKAGE__->set_primary_key("id");

__PACKAGE__->belongs_to(contract => 'Finance::NSCC::Insurance::Schema::Contract',
                        {
                         'foreign.nscc_num'     => 'self.nscc_num',
                         'foreign.contract_num' => 'self.contract_num',
                        },

                       );

1;
